package com.tqq.onlinetest.service.impl;


import com.tqq.onlinetest.dao.TeacherInfoMapper;
import com.tqq.onlinetest.dao.TeacherMapper;
import com.tqq.onlinetest.pojo.Teacher;
import com.tqq.onlinetest.pojo.TeacherInfo;
import com.tqq.onlinetest.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TeacherImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;
    @Autowired
    private TeacherInfoMapper teacherInfoMapper;

    @Override
    public TeacherInfo getTeacherInfoById(String id) {
        return teacherInfoMapper.selectByPrimaryKey(id);

    }

    @Override
    public boolean updateTeacherInfo(TeacherInfo teacherInfo) {
        int affectRow;
        affectRow=teacherInfoMapper.updateByPrimaryKeySelective(teacherInfo);
        if(affectRow!=1) return false;
        else return true;

    }

    @Override
    public Teacher getTeacherLoginById(String id) {
        return teacherMapper.selectByPrimaryKey(id);
    }
}
